<?php
session_start();
header('Content-type: text/html; charset=utf-8');
require_once"lib/functions.php";
require_once"mysql.php";
$login = $_POST['login'];
$password=md5($_POST['password']);

if (checkUser($login, $password)){
	$_SESSION['login']=$login;
	$_SESSION['password']=$password;
	$status=getStatus($login, $password);
	$_SESSION['status']=$status;
	$id=getId($login, $password);
	$_SESSION['user_id']=$id;
	header("Location: chooseCabinet.php");
}else{
	$_SESSION['error_auth']=1;
	header("Location: ".$_SERVER['HTTP_REFERER']);
}


?>



?>